home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9149 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.7 KB  |  37 lines

  1. Newsgroups: comp.lang.c
  2. Path: watt.seas.Virginia.EDU!tdm6d
  3. From: tdm6d@watt.seas.Virginia.EDU (Thomas David Mcgarry)
  4. Subject: Pascal/C/C++ routine interfacing
  5. X-Nntp-Posting-Host: watt.seas.virginia.edu
  6. Message-ID: <DnyE5s.MJJ@murdoch.acc.Virginia.EDU>
  7. Sender: usenet@murdoch.acc.Virginia.EDU
  8. Organization: uva
  9. Date: Fri, 8 Mar 1996 14:41:51 GMT
  10.  
  11. I am trying to either 1. Call a C/C++ routine/function using
  12. pascal or vice versa.  Preferably the former. The documentation
  13. on these things is either horrendous or unavailable.  Borland
  14. threw in a couple of demo programs in older versions of pascal
  15. and C++.  But in the comments, it says you can't use any of the
  16. runtime library routines from C in Pascal wihout declaring them
  17. explicitly in the C routine code and recompiling.  The problem
  18. is that most (if not all) the versions of C/C++ do not come
  19. with the library routine source codes.  
  20.     So I try to link the .OBJ files created by C into
  21. pascal and calll the external functions that I created.  But
  22. when pascal encounters something like a "printf" or "scanf" it
  23. has no idea what these things are.  Do I really have to
  24. recompile even simple functions so pascal can understand?  Is
  25. there an easier way to do this.  I do not want to go through
  26. windows and create DLL's.  I need to pass data between the two
  27. languages.  If this is not possible, can anyone tell me how to
  28. call pascal functions and procedures from inside C code?  I
  29. know a little about the "extern" and "pascal" keywords" but I
  30. have had little luck in doing this.  Help!  I am greatly
  31. indebtted.
  32. -- 
  33. -------------------------------------------------------------------------
  34. Thomas David McGarry
  35. University of Virginia
  36. Materials Science Department
  37.